home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / docs / announc3.lha / 1100 / 1113.progargs < prev    next >
Internet Message Format  |  1995-04-14  |  5KB

  1. From zerkle Thu Apr 13 02:21:41 1995
  2. Received: by toadflax.cs.ucdavis.edu (4.1/UCD.CS.2.6)
  3.     id AA15962; Thu, 13 Apr 95 02:21:40 PDT
  4. Received: from python.CS.ORST.EDU by toadflax.cs.ucdavis.edu (4.1/UCD.CS.2.6)
  5.     id AA15956; Thu, 13 Apr 95 02:21:37 PDT
  6. Received: from gila.CS.ORST.EDU (gila.CS.ORST.EDU [128.193.36.61]) by python.CS.ORST.EDU (8.6.9/8.6.9) with ESMTP id CAA05566 for <announce@cs.ucdavis.edu>; Thu, 13 Apr 1995 02:21:37 -0700
  7. Received: (hackbod@localhost) by gila.CS.ORST.EDU (8.6.9/8.6.4) id CAA27503; Thu, 13 Apr 1995 02:21:40 -0700
  8. Date: Thu, 13 Apr 1995 02:21:40 -0700 (PDT)
  9. From: Dianne Hackborn <hackbod@mail.CS.ORST.EDU>
  10. To: Amiga Announcements <announce@cs.ucdavis.edu>
  11. In-Reply-To: <9504130918.AA15910@toadflax.cs.ucdavis.edu>
  12. Message-Id: <Pine.3.89.9504130253.A27470-0100000@gila.CS.ORST.EDU>
  13. Mime-Version: 1.0
  14. Content-Type: TEXT/PLAIN; charset=US-ASCII
  15. Subject: SUBMIT ProgArgs Library v1.2
  16. Errors-To: zerkle@cs.ucdavis.edu
  17. X-Server: Zserver v0.90beta
  18. Status: RO
  19.  
  20. submit
  21.  
  22. TITLE
  23.  
  24.      ProgArgs Library - program argument parsing support
  25.  
  26. VERSION
  27.  
  28.      1.2
  29.  
  30. AUTHOR
  31.  
  32.      Dianne Hackborn
  33.  
  34.      E-mail: hackbod@mail.cs.orst.edu
  35.  
  36. DESCRIPTION
  37.  
  38.      ProgArgs is a shared library which is intended to make the handling
  39.      of CLI, Workbench and text file arguments simpler and more consistent.
  40.      It basically provides a wrapper around the DOS ReadArgs() function and
  41.      the Workbench argument functions, which unifies them into one standard
  42.      interface.  It also provides support for intelligently writing tool
  43.      types back out to disk -- only modifying the relevant entries, creating
  44.      comments for tool types which do not have a value, etc -- and provides
  45.      for the reading and writing of text files which are formatted much like
  46.      tool types.
  47.      
  48.      The library uses an argument definition format similar to the template
  49.      style used by ReadArgs(), except it extends this to an array of
  50.      structures, to include the additional information needed.  For example,
  51.      to process the arguments "FILES/A/M,ALL/S" with the defaults "#?" and
  52.      "no", a program would look something like this:
  53.      
  54.      #define FILES_ARG (TAG_ARGENTRY+1)
  55.      #define ALL_ARG (TAG_ARGENTRY+2)
  56.  
  57.      struct MultiArg DefFiles[] = {
  58.        { "#?", NULL, NULL },
  59.        { NULL }
  60.      };
  61.  
  62.      struct ArgEntry myEntries[] = {
  63.        { FILES_ARG, "FILES/A/M", "Files to process",
  64.          AEFLAG_DEFAULT, &DefFiles[0], NULL },
  65.        { ALL_ARG, "ALL/S", "Recursively process files",
  66.          AEFLAG_DEFAULT, FALSE, NULL },
  67.        { TAG_END }
  68.      };
  69.      
  70.      ...
  71.  
  72.      struct ProgArgs * myArgs;
  73.  
  74.      myArgs = AllocProgArgs(&myEntries[0],
  75.             PA_WBStartup,       _WBenchMsg,  /* Hand in WB startup */
  76.             RPA_WBArguments,    FILES_ARG,   /* Parse WB startup */
  77.             PA_IgnoreError,     TRUE,        /* Don't fail on next err */
  78.             RPA_ProgIcon,       !_WBenchMsg, /* If no WB startup, read */
  79.                                              /* directly from icon */
  80.             PA_IgnoreError,     FALSE,       /* Allow fail on next err */
  81.             RPA_CmdInput,       TRUE,        /* Parse command line */
  82.             TAG_END);
  83.  
  84.      if(!myArgs) exit(20);
  85.      
  86.      /* Retrieve program arguments */
  87.      
  88.      struct MultiArg* files;
  89.      ULONG all_flag;
  90.  
  91.      GetProgArgs(myArgs, FILES_ARG,&files, ALL_ARG,&all_flag, TAG_END);
  92.     
  93. SPECIAL REQUIREMENTS
  94.  
  95.      OS 2.04 (V37) or greater; tested up to 3.1.
  96.      No other software requirements.
  97.  
  98.      Only tested with SAS/C; no assembly language header files provided.
  99.  
  100. AVAILABILITY
  101.  
  102.      Available from Aminet, eg:
  103.         
  104.      ftp://ftp.wustl.edu/pub/aminet/util/libs/progargs1_2.lha
  105.  
  106.      If you have WWW access, it can also be retrieved from my pages at
  107.      http://www.cs.orst.edu/~hackbod/amiga/
  108.  
  109. PRICE
  110.  
  111.      Shareware.  A fee of $5 is asked for programmers using the
  112.      library who would like more support than the documentation
  113.      provided with it or to include the library binary in their own
  114.      distributions.  There is no shareware fee for end-users.
  115.  
  116. DISTRIBUTABILITY
  117.  
  118.      Copyright (C) 1995 by Dianne Hackborn.
  119.  
  120.      Freely distributable as long as the contents of the archive
  121.      are kept intact.
  122.  
  123. ----------------------------------------------------------------------------
  124. Dianne Kyra Hackborn         "All our lives we love illusion, neatly caught
  125. hackbod@mail.cs.orst.edu     between confusion and the need to know we are
  126. Oregon State University      alive."
  127. //www.cs.orst.edu/~hackbod/                                 -- The Residents
  128.  
  129.  
  130.